home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / idioms.lha / idioms / 10-2.c < prev    next >
C/C++ Source or Header  |  1993-08-08  |  755b  |  23 lines

  1. /* Copyright (c) 1992 by AT&T Bell Laboratories. */
  2. /* Advanced C++ Programming Styles and Idioms */
  3. /* James O. Coplien */
  4. /* All rights reserved. */
  5.  
  6. class EditWindow {
  7. public:
  8.     void addch(char x)       { window->addch(x); }
  9.     void addstr(string x)    { window->addstr(x); }
  10.     void clear()             { window->clear(); }
  11.     . . . .
  12.     EditWindow()             { if (\fIthis_is_an_X_environment\f5) {
  13.                                    window = new XWindow;
  14.                                    . . . . 
  15.                                } else {
  16.                                    window = new CursesWindow;
  17.                                    . . . .
  18.                              } }
  19. private:
  20.     Window *window;
  21.     short topLine, bottomLine;
  22. };
  23.